import { request } from "@/http/axios"
import type * as Params from "@/types/http/params.ts"
import type * as Mocks from "./type"

/**
 * 获取图形验证码
 * @description 获取图形验证码,包含验证码和验证码ID
 */
export function getGraphVerifyCode(data: Params.NoneParam) {
  return request<HttpResult<CodeResult<string>>>({
    url: "/api/auth/account/getGraphVerifyCode",
    method: "post",
    data
  })
}

/**
 * 手机号验证码登录
 * @description 手机号验证码登录,返回登录信息
 * @param cellphone 手机号
 * @param verifyCode 验证码
 */
export function loginByMobileVerifyCode(data: Params.MobileVerifyLoginParam) {
  return request<HttpResult<LoginResult>>({
    url: "/api/auth/account/loginByMobileVerifyCode",
    method: "post",
    data
  })
}

/**
 * 获取当前登录用户详情
 * @description 获取当前登录用户详情
 */
export function getCurrentUserInfo(data: Params.NoneParam) {
  return request<HttpResult<Mocks.UserInfo>>({
    url: "/api/admin/getUserBaseInfo",
    method: "post"
  })
}

